//
//  VersionDataSource.m
//  tcpoctest
//
//  Created by gump on 5/15/13.
//  Copyright (c) 2013 gump. All rights reserved.
//

#import "VersionDataSource.h"

@implementation VersionDataSource

-(id)init
{
    self = [super init];
    if (self) {
        strcontent = @"";
        strurl = @"";
        bshow = false;
        
        pthread_mutex_init(&mutexversion, 0);
    }
    
    return self;
}

-(void)SetContent:(NSString *)str
{
    pthread_mutex_lock(&mutexversion);
    
    strcontent = str;
    
    pthread_mutex_unlock(&mutexversion);
}

-(NSString *)Content
{
    NSString *str = @"";
    
    pthread_mutex_lock(&mutexversion);
    
    str = strcontent;
    
    pthread_mutex_unlock(&mutexversion);
    
    return str;
}

-(void)SetUrl:(NSString *)str
{
    pthread_mutex_lock(&mutexversion);
    
    strurl = str;
    
    pthread_mutex_unlock(&mutexversion);
}

-(NSString *)Url
{
    NSString *str = @"";
    
    pthread_mutex_lock(&mutexversion);
    
    str = strurl;
    
    pthread_mutex_unlock(&mutexversion);
    
    return str;
}

-(void)SetIsShow:(bool)bs
{
    pthread_mutex_lock(&mutexversion);
    
    bshow = bs;
    
    pthread_mutex_unlock(&mutexversion);
}

-(bool)IsShow
{
    bool b = false;
    
    pthread_mutex_lock(&mutexversion);
    
    b = bshow;
    
    pthread_mutex_unlock(&mutexversion);
    
    return b;
}

@end
